package com.toe.commodity.webapi.mapper;


import com.toe.pojo.dto.commodity.CommodityClassesDTO;
import com.toe.pojo.entity.commodity.CommodityClasses;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.toe.pojo.vo.commodity.CommodityClassVO;
import com.toe.pojo.vo.commodity.CommodityOrderClassVO;
import com.toe.pojo.vo.commodity.CommodityUserBuyClassesVO;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 陶涛
 * @since 2022-07-19
 */
@Repository
public interface CommodityClassesMapper extends BaseMapper<CommodityClasses> {
    //添加新的在售课程
    Integer addNewCommodityClass(CommodityClasses commodityClasses);

    //更新在售课程信息
    Integer updateCommodityClass(CommodityClassesDTO commodityClassesDTO);

    //删除在售的课程
    Integer deletedCommodityClass(Long id);

    //根据id查询商品信息
    CommodityClassVO getCommodityClassById(Long id);

    CommodityOrderClassVO getOrderClassById(Long classId);

    //根据商品销量查询商品列表
    List<CommodityClassVO> getCommodityClassBySales();

    //根据类型id查询对应的课程信息
    List<CommodityClassVO> getCommodityClassByClassTypeId(Long id);

    //根据商家id查询对应的课程信息
    List<CommodityClassVO> getCommodityClassByBusinessId(Long id);

    List<CommodityOrderClassVO> listOrderClassesByIds(List<Long> classIds);

    List<CommodityUserBuyClassesVO> listUserBuyClassesByIds(List<Long> classIds);

    List<CommodityClassVO> getCommodityClassByIds(List<Long> ids);
}
